SetCounterConfigExam

Notification before use

Depending on the type of product you are using, the definitions of ‘Parameter’, ‘IO Logic’, ‘AxisStatus’, etc. may be different. This example is based on ‘Ezi-SERVO2’, so please apply the appropriate value depending on the product you are using.

Example)

FM_EZISERVO2_PARAM          // Parameter enum when using 'Ezi-SERVO2'
FM_EZIMOTIONLINK2_PARAM     // Parameter enum when using 'Ezi-MOTIONLINK2'

0. Program scenario

[EN]
1. Connect a device. 2. Read the Counter Config value. 3. Configure the Counter Config value. 4. Read the modified Counter Config value. 5. Close connection.

[KR]
1. 장치 연결. 2. Counter Config 값 읽기. 3. Counter Config 값 설정. 4. 수정 된 Counter Config 값 읽기. 5. 연결 해제.

1. Set Counter Config

unsigned char byChannel = 0;                //Channel = 0
int lRecv = 0;

printf("---------------------------------- \n");
// Set Counter Input Mode
if (FAS_SetCounterConfig(nBdID, byChannel, CFG_INPUT_MODE, 1, &lRecv) != FMM_OK)
{
    printf("Function(FAS_SetCounterConfig) was failed.\n");
}
.....

[EN]
You can set the Counter Config using the FAS_SetCounterConfig() function. Meaning of each argument is as follows sequentially: ‘ID number of the board’, ‘Channel number’, ‘Counter Config Type’, ‘Value to be modified’, ‘Value after modified’

[KR]
FAS_SetCounterConfig() 함수를 사용하여 Counter Config를 설정할 수 있습니다. 해당 함수의 각 인자는 순차적으로 다음을 의미합니다. ‘해당 보드의 ID번호’, ‘채널 번호’, ‘Counter Config Type’, ‘수정할 값’, ‘수정된 값’

1.1 Counter Config Type

[EN]
COUNTER_CONFIG(CFG_INPUT_MODE) is a structure that organizes Counter Config Type and can be checked in the header file (MOTION_DEFINE.h).

[KR]
COUNTER_CONFIG(CFG_INPUT_MODE)는 Counter Config Type이 정리된 구조체이며 헤더파일 (MOTION_DEFINE.h)에서 확인하실 수 있습니다.

2. Get Counter Config

unsigned char byChannel = 0;    //Channel 0
int lRecv = 0;

printf("---------------------------------- \n");
// Get Counter Input Mode
if (FAS_GetCounterConfig(nBdID, byChannel, CFG_INPUT_MODE, &lRecv) != FMM_OK)
{
    printf("Function(FAS_GetCounterConfig) was failed.\n");
}
.....

[EN]
You can read the set Counter Config value using the FAS_GetCounterConfig() function. Meaning of each argument is as follows sequentially: ‘ID number of the board’, ‘channel number’, ‘Counter Config Type number to read’, ‘variable to store the read value’

[KR]
FAS_GetCounterConfig() 함수를 사용하여 설정된 Counter Config 값을 읽어올 수 있습니다. 해당 함수의 각 인자는 순차적으로 다음을 의미합니다. ‘해당 보드의 ID번호’, ‘채널 번호’, ‘읽어들일 Counter Config Type 번호’, ‘읽어들인 값을 저장할 변수’

3. Etc

[EN]
1. Please refer to the [01.ConnectionExam] project document for function descriptions on connecting and disconnecting devices.

[KR]
1. 장치 연결 및 해제에 대한 함수 설명은 [01.ConnectionExam] 프로젝트 문서를 참고하시기 바랍니다.